package priv.lirenhe.dissertation.dao.mysql.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import priv.lirenhe.dissertation.dao.mysql.WebUrlMapper;
import priv.lirenhe.dissertation.domain.mysql.WebUrl;
import priv.lirenhe.dissertation.domain.mysql.WebUrlExample;

@Repository("WebUrlMapperImpl")
public class WebUrlMapperImpl implements WebUrlMapper{

	@Resource
	private SqlSessionTemplate sqlSessionTemplate = null;
	

	@Override
	public long countByExample(WebUrlExample example) {
		long countByExampleNumber = sqlSessionTemplate.selectOne("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.countByExample",example);
		return countByExampleNumber;
	}

	@Override
	public int deleteByExample(WebUrlExample example) {
		int deleteByExampleNumber = sqlSessionTemplate.delete("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.deleteByExample", example);
		return deleteByExampleNumber;
	}

	@Override
	public int deleteByPrimaryKey(Long webUrlId) {
		int deleteByPrimaryKeyNumber = sqlSessionTemplate.delete("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.deleteByPrimaryKey", webUrlId);
		return deleteByPrimaryKeyNumber;
	}

	@Override
	public int insert(WebUrl record) {
		int insertNumber = sqlSessionTemplate.insert("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.insert",record);
		return insertNumber;
	}

	@Override
	public int insertSelective(WebUrl record) {
		int insertSelectiveNumber = sqlSessionTemplate.insert("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.insertSelective",record);
		return insertSelectiveNumber;
	}

	@Override
	public List<WebUrl> selectByExample(WebUrlExample example) {
		List<WebUrl> ListOfselectByExample = sqlSessionTemplate.selectList("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.selectByExample",example);
		return ListOfselectByExample;
	}

	@Override
	public WebUrl selectByPrimaryKey(Long webUrlId) {
		WebUrl webUrlOfSelectByPrimaryKey = sqlSessionTemplate.selectOne("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.selectByPrimaryKey",webUrlId);
		return webUrlOfSelectByPrimaryKey;
	}

	@Override
	public int updateByExampleSelective(WebUrl record, WebUrlExample example) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("record", record);
		map.put("record", example);
		int updateByExampleSelectiveNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.updateByExampleSelective",map);
		return updateByExampleSelectiveNumber;
	}

	@Override
	public int updateByExample(WebUrl record, WebUrlExample example) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("record", record);
		map.put("record", example);
		int updateByExampleNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.updateByExample",map);
		return updateByExampleNumber;
	}

	@Override
	public int updateByPrimaryKeySelective(WebUrl record) {
		int updateByPrimaryKeySelectiveNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.updateByPrimaryKeySelective",record);
		return updateByPrimaryKeySelectiveNumber;
	}

	@Override
	public int updateByPrimaryKey(WebUrl record) {
		int updateByPrimaryKeyNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebUrlMapper.updateByPrimaryKey",record);
		return updateByPrimaryKeyNumber;
	}

}
